<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var str = "hello world";
    str = "hello javascript";
    console.log(str.length);
    console.log(str[str.length-1]);
    for(i=0;i<str.length;i++){
        console.log(str[i]);
        //consolo.log(str.charAt(i));
    }
    //夫字符串，indexOf(子字符串)
    //在父字符串中查找子字符串出现的位置
    //如果查找到了匹配的子字符串，返回子字符串出现的索引位置
    //如果查找不到，则返回-1
</script>
</html>